package test.action;

import java.util.Map;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import struts.action.Action;
import struts.form.ActionForm;
import test.form.LoginForm;

/**
 * 业务逻辑层
 * 
 * @author zhouhong
 * @date 2014-9-21 新建
 */
public class LoginAction implements Action{

	@Override
	public String execute(HttpServletRequest req, HttpServletResponse resp,
			ActionForm form, Map<String, String> actionForward) {
		System.out.println("=============================");
		String forwardUrl = null;
		LoginForm loginForm = (LoginForm)form;
		if("zhouhong".equals(loginForm.getUsername()) && "123456".equals(loginForm.getPassword())){
			forwardUrl = actionForward.get("success");
		}else{
			forwardUrl = actionForward.get("failed");
		}
		return forwardUrl;
	}
	
}
